/*处理登录用户权限的页面*/
import request from '@/helpers/request'
import { JSEncrypt } from 'jsencrypt' //RSA加密传输
import querystring from 'querystring' //序列化请求参数
import { format } from 'util';

let formatData = (data) => {
    return querystring.stringify(data)
}//序列化请求参数 封装函数

const URL = {
    putPhone:'/nsgame/putPhone',
    addGame:'/nsgame/addGame',
    getPhoto:'/nsgame/getPhoto',
    getPhotoById:'/nsgame/getPhotoById'
}

export default {
    putPhone(phone) {
        console.log( phone)
        return request(URL.putPhone, 'POST', formatData({phone}), { isToken: false })
    },
    addGame(param){
        return request(URL.addGame, 'POST', formatData(param), { isToken: false })
    },
    getPhoto(){
        return request(URL.getPhoto, 'GET', {}, { isToken: false })
    },
    getPhotoById(id){
        return request(URL.getPhotoById, 'GET', {id}, { isToken: false })
    }

}